/*
 * cWorldMap.cpp
 *
 *  Created on: 26.04.2012
 *      Author: e_krais
 */

#include "cWorldMap.h"

namespace ants {

cWorldMap::cWorldMap(int width, const int height, const int blockSize) {

	m_w 	= width;
	m_h 	= height;
	m_bsize = blockSize;

	m_map = (int**)new int[width][height];

	fillmap(3);
}

cWorldMap::~cWorldMap() {

}

void cWorldMap::SetBlock(int x, int y, int value)
{
	m_map[x][y] = value;
}

void cWorldMap::fillmap(int value)
{
	for (int i=0; i<m_w; ++i)
	{
		for (int j=0; j<m_h; ++j)
		{
			SetBlock(i, j, value);
		}
	}
}

void cWorldMap::printmap()
{
	printf("\nWorldmap data:\n");
	for (int i=0; i<m_w; ++i)
	{
		std::string line = "";
		for (int j=0; j<m_h; ++j)
		{
			line.append("%i ",m_map[i][j]);
		}
		line.append("\n");
		printf(line.c_str());
	}
}


}
